package demo7;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Demo {
    public static void main(String[] args) {
        System.out.println("创建Spring容器");
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext("demo7");
        System.out.println("通过Spring容器创建完毕");
        Person person = context.getBean(Person.class);
        System.out.println("通过Spring容器获取到对象"+person);
        System.out.println("使用Person对象进行实际操作");
        System.out.println("最终关闭Spring容器");
        context.close();
    }
}
